#include <iostream>
#include <vector>
#include <list>
#include <deque>
#include <string>

using namespace std;

int main()
{
	list<string> slst;
	string str;

	cout<<"enter some string:"<<endl;
	while(cin>>str)
		slst.push_back(str);
	cin.clear();
	
	cout<<"enter the string you want:"<<endl;
	cin>>str;

	for(list<string>::iterator iter = slst.begin(); iter != slst.end();++iter)
	{
		if(*iter==str)
		{
			iter = slst.erase(iter);
			--iter;
		}
	}
	return 0;
}
